//
//  QASectionSegView.m
//  BaseProject
//
//  Created by 王洋 on 2021/1/6.
//  Copyright © 2021 王洋. All rights reserved.
//

#import "QASectionSegView.h"

@implementation QASectionSegView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.hotestBtn.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
    self.newestBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];

    [self.hotestBtn setTitleColor:UIColorHex(0x222222) forState:UIControlStateNormal];
    [self.newestBtn setTitleColor:UIColorHex(0x333333) forState:UIControlStateNormal];
    
    self.hotSlide.hidden = NO;
    self.newestSlide.hidden = YES;
}


- (IBAction)hotAction:(id)sender {
    
    self.hotestBtn.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
    self.newestBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];

    [self.hotestBtn setTitleColor:UIColorHex(0x222222) forState:UIControlStateNormal];
    [self.newestBtn setTitleColor:UIColorHex(0x333333) forState:UIControlStateNormal];
    
    self.hotSlide.hidden = NO;
    self.newestSlide.hidden = YES;
    
    if (self.QAListHeaderViewBlock) {
        self.QAListHeaderViewBlock(QAListHeaderActionType_hot);
    }
}

- (IBAction)newAction:(id)sender {
    
    self.hotSlide.hidden = YES;
    self.newestSlide.hidden = NO;

    [self.newestBtn setTitleColor:UIColorHex(0x222222) forState:UIControlStateNormal];
    [self.hotestBtn setTitleColor:UIColorHex(0x333333) forState:UIControlStateNormal];

    self.newestBtn.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
    self.hotestBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
    
    if (self.QAListHeaderViewBlock) {
        self.QAListHeaderViewBlock(QAListHeaderActionType_new);
    }
}

@end
